import com.sun.org.apache.xpath.internal.objects.XString;
import javafx.scene.Node;

import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main mi =new Main();
        Scanner input = new Scanner(System.in);

        int n = input.nextInt();

        String str = "";
        for(int i = 1; i <= n;i++){
            str += i + ",";
        }
        StringBuilder strb =new StringBuilder(str);
        int num = 0;
        int i = 0;
        while (true){

            if(strb.length() == 2){
                break;
            }

            try{
                str.charAt(i);
            }catch (StringIndexOutOfBoundsException e){
                num += i;
                i = 0;
            }

            if( (i + num + 1)%3 == 0){
                strb.deleteCharAt(i);
                strb.deleteCharAt(i+1);
            }

            i++;
            i++;
        }
        strb.deleteCharAt(1);

        System.out.println( strb );




       /* String []strings = input.nextLine().split(",");//分割开m和n

        int m = mi.getMN(strings[0]);//获取到m的值
        int n = mi.getMN(strings[1]);//获取到n的值

        String str_A = input.nextLine();//获取数组A的元素的字符串
        String str_B = input.nextLine();//获取数组B的元素的字符串

        int []A = mi.getArray(str_A,m+n);//获取到数组A
        int []B = mi.getArray(str_B,n);//获取数组B


        mi.solve(A,B,m);//合并A和B
        Arrays.sort(A);//排序
        mi.show(A);//输出结果*/

    }

    public int getMN(String s){//将m和n的值取出
        String str ="";
        for (int i = 2 ; i < s.length() ;i++){
            str += s.charAt(i) ;
        }
        return Integer.parseInt(str);
    }

    public int[] getArray(String str,int MN){//获取数组元素
        String []strings =str.split(",");
        int []array = new int[MN];

        for (int i = 0;i < strings.length;i++){
            array[i] = Integer.parseInt(strings[i]);
        }

        return array;

    }

    public void solve(int []A , int []B , int m){
        for (int i = 0; i < B.length;i++){
            A[m + i] = B [i];
        }
    }

    public void show(int []A){
        for (int i = 0;i < A.length;i++){
            System.out.print(A[i]+" ");
        }
    }
}
